<template>
	<div class="wrapper">
		<h1>这是主页</h1>
		<ul>
			<li v-for="item in msgLists" :key="item.h_id">
				<img :src="item.url" :alt="item.title">
				<p>- {{item.description}} -</p>
			</li>
		</ul>
	</div>
</template>

<script>
export default {
  name: 'home',
  data () {
    return {
    	msgLists:[]
    }
  },
  methods:{
    getHomeMsg: function(){
      this.$axios.get('/api/user/getHomeMsg')
      .then((res) => {
        console.log(res.data)
        this.msgLists = res.data
      })
      .catch((err) => {
        console.log(err)
      })
    }
  },
  mounted(){
    this.getHomeMsg()
  }
}
</script>

<style scoped>
.wrapper ul{
	list-style: none;
	margin: 0;
}
</style>
